﻿using BCCommon;
using BCDto.WeChatComponent.WeChatUser;
using System;
using System.Collections.Generic;
using System.Text;

namespace BCService.WeChatComponent.WeChatUserRelevantService
{
    /// <summary>
    /// 微信用户相关服务接口
    /// </summary>
    public interface IWeChatUserRelevantService
    {
        /// <summary>
        /// 同步微信用户OpenId
        /// </summary>
        /// <returns></returns>
        void SynchronizeUserOpenId();
        /// <summary>
        /// 同步微信用户信息
        /// </summary>
        void SynchronizeUserInfo();
        /// <summary>
        /// 获取单个微信用户基本信息
        /// </summary>
        /// <param name="openId">用户OpenId</param>
        /// <param name="lang">获取信息语言</param>
        /// <returns></returns>
        WeChatUserDto GetUserInfo(string openId,string lang="zh_CN");
        /// <summary>
        /// 批量获取微信用户基本信息
        /// </summary>
        /// <param name="openIds">用户OpenIds</param>
        /// <param name="lang">获取信息语言</param>
        /// <returns></returns>
        WeChatUserListDto BatchGetUserInfo(IEnumerable<string> openIds, string lang = "zh_CN");
        /// <summary>
        /// 获取微信用户列表
        /// </summary>
        /// <param name="name">用户名</param>
        /// <param name="start">开始时间</param>
        /// <param name="end">结束时间</param>
        /// <param name="tagId">标签Id</param>
        /// <param name="subscribeScene">关注渠道</param>
        /// <param name="remark">用户备注名</param>
        /// <param name="phone">用户手机号</param>
        /// <param name="country">国家</param>
        /// <param name="province">省份</param>
        /// <param name="city">城市</param>
        /// <param name="role">角色</param>
        /// <param name="ascending">排序</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">每页数据条数</param>
        /// <returns></returns>
        PageableList<WeChatUserInfoDto> Get(string name, DateTime? start, DateTime? end, int? tagId, string subscribeScene, string remark, string phone, string country, string province, string city, string role, bool? ascending, int pageIndex = 1, int pageSize = 10);
        /// <summary>
        /// 更新用户备注名
        /// </summary>
        /// <param name="openid">OpenId</param>
        /// <param name="remark">备注名</param>
        void UpdateRemark(string openid,string remark);


        /// <summary>
        /// 微信用户根据临时Code登陆验证
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        WeChatUserDto Login(string code);
        /// <summary>
        /// 微信用户根据临时Code登陆验证（小程序专用）
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        WeChatUserDto MinProgramLogin(string code);

    }
}
